package day15;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Teacher {
    public static Teacher aaa = null;
    private Integer id;
    private String name;

    @Override
    protected void finalize() throws Throwable {

        aaa = this;
        System.out.println("GC回收对象之前，会自动调用该对象的此方法" + this.getName());
    }
}
